package haha;

public class Bongbong {
	private String mausac;
	private float bankinh;
	
	public String getMausac() {
		return mausac;
	}
	public void setMausac(String mausac) {
		this.mausac = mausac;
	}
	public float getBankinh() {
		return bankinh;
	}
	public void setBankinh(float bankinh) throws Exception{
		if (bankinh<=0)
			throw new Exception ("Ban kinh khong hop le");
		this.bankinh = bankinh;
	}
	public void cang(int sucep) {
		bankinh=sucep*100/2;
	}
	public Bongbong() {
		mausac="no-color";
		bankinh=1.0f;
		// TODO Auto-generated constructor stub
	}
	public Bongbong(String mausac, float bankinh) {
		
		this.mausac = mausac;
		this.bankinh = bankinh;
	}
	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Bongbong bb = (Bongbong) obj;
		if (mausac == null) {
			if (bb.mausac != null)
				return false;
		} else if (!mausac.equalsIgnoreCase(bb.mausac))
			return false;
		return true;
	}
	@Override
	public int hashCode() {
		return mausac.hashCode();
	}
	@Override
	public String toString() {
		return "Bongbong [mausac=" + mausac + ", bankinh=" + bankinh + "]";
	}
	
	
}
